1. Field of the Invention
This invention generally relates to computer systems, and in particular to time synchronization in computer systems. Even more specifically, the invention relates to methods and systems for calculating clock offset and skew between two clocks in a computer system.
2. Background Art
Modern computers use clocks for many purposes, including ensuring that many operations occur in the proper sequence or in synchronization. Because of this, it is important that the clocks themselves operate in close synchronization. Typically, two clocks are often not in perfect synchronization, and there are timing differences between the clocks. In addition, two clocks may not operate at the exact same frequency, so that the timing difference between the clocks changes over time. This change in the timing difference between the clocks is referred to as the clock skew.
Many computer timing protocols require information such as the estimation of the skew and offset between two clocks. These two clocks may be, for example, a local clock and its source clock. For example, the Server Timing Protocol (STP) requires the estimation of the skew and offset between the local clock and the clock source. The accuracy of the estimation is crucial for the synchronization accuracy of the protocol. While methods and systems to measure clock skew are known, these known procedures tend to be quite complex, unreliable in certain situations, or both.
Moreover, estimating clock skew and offset can be complicated by turning points in the time delay data. Because of this, turning point detection is crucial in the mixed CTN environment, when, for example ETR (9037) is the clock server. As ETR can change its steering rate by 25 ppm without informing anyone, the synchronization algorithm needs to quickly detect such turns. Any delay in the detection can result in the loss of tens of microseconds in accuracy.